<template>
    <div v-if="visible" class="modal-overlay">
        <div class="modal">
            <div class="close" @click="handleClose"></div>
            <div class="modal-header">
                <h3>{{title}}</h3>
                <p>{{title2}}</p>
            </div>
            <div class="modal-footer">
                <p class="confirm-button" @click="handleClose">{{ cancel_title }}</p>
                <p class="confirm-button" @click="paySubmit">{{ sub_title }}</p>
            </div>
        </div>
    </div>
</template>

<script setup>
defineProps(['title','cancel_title','sub_title','visible','handleClose','paySubmit','title2'])
</script>

<style lang="less" scoped>
/* 模态框样式 */
.modal-overlay,
.modal-setPwd {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-setPwd {
  z-index: 1001 !important;
}

.modal {
  background: linear-gradient(to bottom right, #f9f9f9, #ffffff);
  padding: 25px 50px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
//   width: 300px;
  text-align: center;
  position: relative;
  min-width: 240px;
}

.modal-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  flex-direction: column;
  p{
    font-size: 13px;
    margin-top: 10px;
    color: #878787;
  }
}

.modal-header h3 {
  margin: 0;
  font-size: 24px;
  color: #3c4043;
  font-family: "Roboto", sans-serif;
}

.close-button1 {
  background: none;
  border: none;
  font-size: 28px;
  color: #9aa0a6;
  cursor: pointer;
  transition: color 0.3s ease;
  position: absolute;
  right: 20px;
  top: 5px;
}

.close-button1:hover {
  color: #1a73e8;
}

.modal-body {
  margin-bottom: 20px;
}

.modal-body label {
  display: block;
  font-size: 16px;
  color: #3c4043;
  margin-bottom: 5px;
  font-family: "Roboto", sans-serif;
}

.modal-body input {
  width: 90%;
  padding: 10px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-size: 16px;
  font-family: "Roboto", sans-serif;
}

.modal-footer {
  display: flex;
  justify-content: space-around;
}

.modal-footer p {
  margin-left: 10px;
  padding: 8px 25px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Roboto", sans-serif;
  margin-right: 0;
  background-color: @primary-color;
  color: white;
}

.modal-footer .cancel-button {
  background-color: #f5f5f5;
  color: #3c4043;
}

.modal-footer .cancel-button:hover {
  background-color: #ebebeb;
}

.modal-footer .confirm-button {
  background-color: #1890ff;
  color: #fff;
}

.modal-footer .confirm-button:hover {
  background-color: #5cb0ff;
}
</style>